﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;  


    public enum Order { Ascending, Decending }

    public class QualifyRoundPlayerComparer : IComparer<QualifyRound>
    {
        Order order = Order.Ascending;

        public int Compare(QualifyRound x, QualifyRound y)
        {
            if (order == Order.Ascending)
            {
                return x.PlayerNumber.CompareTo(y.PlayerNumber);
            }
            else
            {
                return y.PlayerNumber.CompareTo(x.PlayerNumber);
            }
        }

        public QualifyRoundPlayerComparer(Order order)
        {
            this.order = order;
        }
    }

    public class QualifyRoundNumberComparer : IComparer<QualifyRound>
    {
        Order order = Order.Ascending;

        public int Compare(QualifyRound x, QualifyRound y)
        {
            if (order == Order.Ascending)
            {
               
                    return x.Round_Number.CompareTo(y.Round_Number);
               
            }
            else
            {
               
                    return y.Round_Number.CompareTo(x.Round_Number);
                
            }
        }

        public QualifyRoundNumberComparer(Order order)
        {
            this.order = order;
        }
    } 

